﻿using MbUnit.Framework;

namespace NEnsure.UnitTests
{
	[TestFixture]
	public class BusinessRuleTests
	{
		[Test]
		public void Two_Business_Rules_Are_Equal_If_They_Have_The_Same_Key_And_Are_Of_The_Same_Type()
		{
			IBusinessRule one = Rule.GetEqualToRuleForType<string>("some value");
			IBusinessRule two = Rule.GetEqualToRuleForType<string>("some other value");

			Assert.AreEqual(one, two);
		}

		[Test]
		public void Two_Business_Rules_Are_Not_Equal_If_They_Have_The_Same_Key_But_Operate_On_Different_Types()
		{
			IBusinessRule one = Rule.GetEqualToRuleForType<string>("some value");
			IBusinessRule two = Rule.GetEqualToRuleForType<int>(5);

			Assert.AreNotEqual(one, two);
		}
	}
}
